package cn.chinaunicom.admin.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.chinaunicom.admin.dao.FieldsMapper;
import cn.chinaunicom.admin.entity.Fields;
import cn.chinaunicom.admin.service.IFieldsService;

/**
 * @Description: 字段配置
 * @Author: jeecg-boot
 * @Date: 2023-10-24
 * @Version: V1.0
 */
@Service
public class FieldsServiceImpl extends ServiceImpl<FieldsMapper, Fields> implements IFieldsService {

    @Override
    public boolean saveFields(Fields fields) {
        this.save(fields);
        return false;
    }

    @Override
    public boolean updateFields(Fields fields) {
        return this.updateById(fields);
    }


    @Override
    public boolean updateStsById(Integer id) {
        return false;
    }

    @Override
    public boolean check(Integer id) {
        return false;
    }

    @Override
    public boolean batchSave() {
        return false;
    }

    @Override
    public boolean batchUpd() {
        List<Fields> list = this.list();
        list.stream().forEach(x -> x.setFiledName(x.getFiledName() + "-b"));
//        this.updateBatchById(list);
        this.saveOrUpdateBatch(list);
        return false;
    }
}
